import server from '@dt/server/dt'

const api = {
  getBindSysMenuById: server.api().get('/sa-admin/api/v1/authMenu/getBindSysMenuById'),
  permissionMenuDelete: server.api().get('/sa-admin/api/v1/authMenu/delete'),
  permissionMenuSave: server.api().post('/sa-admin/api/v1/authMenu/save'),
  permissionMenuUpdate: server.api().post('/sa-admin/api/v1/authMenu/update'),
  permissionMenuBind: server.api().post('/sa-admin/api/v1/authMenu/bind')
}

function getBindSysMenuById(info) {
  return api.getBindSysMenuById.fetch(info)
}

function permissionMenuDelete(id) {
  let params = { id }
  return api.permissionMenuDelete.fetch(params)
}

function permissionMenuSave(info) {
  return api.permissionMenuSave.fetch(info)
}

function permissionMenuUpdate(info) {
  return api.permissionMenuUpdate.fetch(info)
}

function permissionMenuBind(info) {
  return api.permissionMenuBind.fetch(info)
}

export default {
  getBindSysMenuById,
  permissionMenuDelete,
  permissionMenuSave,
  permissionMenuUpdate,
  permissionMenuBind
}
